﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using WpfStarterKit.Framework.Commands;
using WpfStarterKit.Framework.ViewModel;
using WpfStarterKit.Framework.Navigation;

namespace WpfStarterKit.SampleApplication.Screens.PassingDataInterface.DataPage2
{
    public class DataPage2ViewModel : UserInterfaceViewModel, IConsumeData
    {
        public DataPage2ViewModel()
        {
            HomeCommand = new NavigationCommand(NavigationActions.Start);
            Page1Command = new NavigationCommand(NavigationActions.DataPage1);
        }

        public virtual ICommand HomeCommand { get; set; }
        public virtual ICommand Page1Command { get; set; }
        public virtual string Page1Data { get; set; }

        #region IConsumeData Members

        public void ConsumeData(string sender, object data)
        {
            if(sender == NavigationActions.DataPage1)
            {
                Page1Data = data as string;
            }
        }

        #endregion
    }
}
